using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Controls_DataEntryControls_CheckBoxControl : System.Web.UI.UserControl
{
    private bool m_checked = false;
    protected void Page_Load(object sender, EventArgs e)
    {
        m_checked = CheckBox1.Checked;
    }
    public object Checked
    {
        get { return m_checked; }
        set
        {
            if (value == null) m_checked = false;
            else if (value.GetType() == DBNull.Value.GetType()) m_checked = false;
            else if (value.GetType() == typeof(bool)) m_checked = (bool)value;
            else m_checked = false;
        }
    }
    protected void Page_PreRender()
    { 
        CheckBox1.Checked = m_checked; 
    }
}
